<template>
  <view class="mine">
    <NavbarRight
      title=""
      bgColor="transparent"
      :isBack="false"
    />
    <view class="background"> </view>
    <view class="content">
      <user-header></user-header>
      <my-package></my-package>
    </view>
  </view>
</template>

<script setup>
import NavbarRight from "@/components/navbar-right/index.vue";
import UserHeader from "./components/user-header.vue";
import MyPackage from "./components/my-package.vue";
import { checkToken } from "@/utils/common.js";

import { onLoad, onShow } from "@dcloudio/uni-app";

import useUserStore from "@/store/user.js";
import { storeToRefs } from "pinia";
const userStore = useUserStore();
const { userInfo } = storeToRefs(userStore); // 响应式
const { getUserInfo } = userStore; // actions
// 获取系统状态栏的高度
onLoad(() => {});
onShow(() => {
  if (checkToken()) {
    getUserInfo();
  }
});
</script>

<style lang="scss" scoped>
.mine {
  position: relative;
  height: 100vh;
  background: #ffffff;
  display: flex;
  flex-direction: column;

  .background {
    width: 100%;
    height: 780rpx;
    top: 0;
    left: 0;
    position: absolute;
    background: linear-gradient(180deg, #90e4ed 0%, #ffffff 100%);
  }

  .content {
    height: 100%;
    overflow: auto;
    position: relative;
    z-index: 10;
    padding: 48rpx 32rpx;
  }
}
</style>
